home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / c / AmiVoGL_MDEV.lha / examples / sinewave.c.bak < prev    next >
Text File  |  1997-08-18  |  920b  |  78 lines

  1. #ifdef SGI
  2. #include "gl.h"
  3. #include "device.h"
  4. #include "hershey.h"
  5. #else
  6. #include "vogl.h"
  7. #include "vodevice.h"
  8. #endif
  9.  
  10. #ifndef TC
  11. #include <math.h>
  12. #else
  13. extern double sin(), cos();
  14. #endif
  15.  
  16. #ifndef PI
  17. #define PI    3.14159261358979
  18. #endif
  19.  
  20. #define    STEP    PI / 180.0
  21.  
  22. int main(void)
  23. {
  24.     float a;
  25.     int i;
  26.     float v[2];
  27.     short    val;
  28.  
  29.     winopen("bgnline/endline test");
  30.     unqdevice(INPUTCHANGE);
  31.     qdevice(KEYBD);
  32.     color(BLACK);
  33.     clear();
  34.     ortho2(-0.5, 2 * PI + .5, -1.5, 1.5);
  35.  
  36.     color(GREEN);
  37.     bgnline();
  38.         v[0] = -0.5;
  39.         v[1] = 0.0;
  40.         v2f(v);
  41.  
  42.         v[0] = 2 * PI + .5;
  43.         v[1] = 0.0;
  44.         v2f(v);
  45.     endline();
  46.  
  47.     color(RED);
  48.     bgnline();
  49.         v[0] = 0.0;
  50.         v[1] = -1.3;
  51.         v2f(v);
  52.  
  53.         v[0] = 0.0;
  54.         v[1] = 1.3;
  55.         v2f(v);
  56.     endline();
  57.  
  58.  
  59.     color(YELLOW);
  60.     bgnline(); 
  61.         v[0] = v[1] = 0.0;
  62.         v2f(v);
  63.  
  64.         for (a = 0.0; a <= 2 * PI; a += STEP) {
  65.             v[0] = a;
  66.             v[1] = cos(a);
  67.             v2f(v);
  68.         }
  69.     endline();
  70.  
  71.     circ(60,100,40);
  72.  
  73.     qread(&val);
  74.  
  75.     gexit(); 
  76. }
  77.  
  78.